$('#signin_signup').live('click', function(){
	if (typeof(popupTicketOpen)=='undefined') popupTicketOpen = new popUp();
    popupTicketOpen.load('/auth/login',
    {
    	callback: function(){
    	    $('#signin').hide();
    	    $('#signup').hide();
    	},
    	width: '220px',
        title:'Login',                       
        buttons: [
            {
                value: 'SignIn',
                clickFunction: function(){
                    $('input[name=signin]').click();
                }                    
            },
            {
                value: 'Cancel',
                clickFunction: function(){
                    if (typeof(popupTicketOpen)!='undefined') popupTicketOpen.hide();
                }                    
            },
            {
            	value: 'New user?',
            	clickFunction: function(){
            		if (typeof(popupTicketOpen)=='undefined') popupTicketOpen = new popUp();
            	    popupTicketOpen.load('/auth/signup',
            	    {
            	    	width: '260px',
            	    	callback: function(){
            	    	    $('#register').hide();
            	    	},
            	        title:'Login',                       
            	        buttons: [
            	            {
            	                value: 'Submit',
            	                clickFunction: function(){
            	                	$('#register').click();
            	                }                    
            	            },
            	            {
            	                value: 'Cancel',
            	                clickFunction: function(){
            	                    if (typeof(popupTicketOpen)!='undefined') popupTicketOpen.hide();
            	                }                    
            	            }
            	        ]
            	    });
            	}
            }
        ]
    });
    return false;
});
$(document).ready(function(){
	$('.form_validate').validate();
});
$('#forgot').live('click', function(){
	if (typeof(popupTicketOpen)=='undefined') popupTicketOpen = new popUp();
            	    popupTicketOpen.load('/auth/forgotpass',
            	    {
            	    	width: '260px',
            	    	callback: function(){
            	    	    $('input#submit').hide();
            	    	},
            	        title:'Retrieve your pass',                       
            	        buttons: [
            	            {
            	                value: 'Submit',
            	                clickFunction: function(){
            	                	$('input#submit').click();
            	                }                    
            	            },
            	            {
            	                value: 'Cancel',
            	                clickFunction: function(){
            	                    if (typeof(popupTicketOpen)!='undefined') popupTicketOpen.hide();
            	                }                    
            	            }
            	        ]
            	    });
            	    return false;
});
